<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:f="http://xmlns.jcp.org/jsf/core">

<h:head>
    <title>USER</title>
</h:head>
<h:body onload="#{PackageManaged.handleError()}">
	<h:form>
    <p:menubar>  
        <p:menuitem value="Home" url="home.xhtml" />  
        <p:submenu label="Package Section" >  
            <p:menuitem value="All Packages" url="package.xhtml" />  
        </p:submenu>  
  
        <p:submenu label="Gift List" >  
            <p:menuitem value="My Gift List" url="giftList.xhtml" />    
        </p:submenu>  
  
       <f:facet name="options">   
       		<p:commandButton value="Edit Profile" action="profileEdit.xhtml"/>
            <p:commandButton value="Logout" action="#{LoginManaged.logout()}" icon="ui-icon-close" />
       </f:facet>
    </p:menubar>  
    </h:form>

	<h:form>
	<p:panelGrid columns="2">
		<p:outputLabel>Going</p:outputLabel>
		<p:outputLabel>Return</p:outputLabel>
		<p:inputText value="#{searchBean.sDTO.departurePlace}" />
		<p:inputText value="#{searchBean.sDTO.arrivalPlace}" />
		<p:calendar value="#{searchBean.sDTO.departureDate}" mode="inline" />
		<p:calendar value="#{searchBean.sDTO.arrivalDate}" mode="inline" />
		<p:commandButton value="Search" action="#{searchBean.search}" ajax="false"/>
	</p:panelGrid>
	<p:dataTable id="datatable" var="r" value="#{searchBean.result}">
		<p:column headerText="Name">
			<h:outputText value="#{r.name}" />
		</p:column>
		<p:column headerText="Description">
			<h:outputText value="#{r.description}" />
		</p:column>
		<p:column headerText="Nation">
			<h:outputText value="#{r.nation}" />
		</p:column>
		<p:column headerText="View">    
            <p:commandButton value="View" action="#{PackageManaged.changePage(r.id)}" ajax="false" />
        </p:column>	
	</p:dataTable>
	<p:messages id="messages" showDetail="true" autoUpdate="true" closable="true" />
	</h:form>
</h:body>
</html>